<template>
	<view class="u-content">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: '', // 内容
				type: '', // 类型，1为用户隐私协议 2为礼币用户协议
			}
		},
		methods: {
			// 获取小程序设置
			getSysSite(){
				var that = this
				that.$http.get('api/SysSite/index').then(res=> {
					if(res){
						if(that.type == 2){
							that.content = res.list[0].currency_agreement
						}else if(that.type == 1){
							that.content = res.list[0].agreement
						}
					}
				})
			}
		},
		onLoad(e) {
			this.type = e.type
			if(e.type){
				this.getSysSite()
			}
		}
	}
</script>

<style lang="scss" scoped>
.u-content {
	padding: 30rpx;
}
</style>
